/**
 * 
 */
package note;

import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import java.awt.GridLayout;

/**
 * @author haiyuzha
 *
 */

public class NoteListPanel extends JPanel {
	private DefaultListModel listModel;
	private JList list;

	public NoteListPanel() {
		setLayout(new GridLayout(0, 1));
		DefaultListModel noteListModel = new DefaultListModel();
		noteListModel.addElement("This is a whole new day. Everybody's enjoy their happy" +
				" holiday.\n");
		noteListModel.addElement("You know what?");
		noteListModel.addElement("You should find a better way to explain what you've seen.");
		noteListModel.addElement("Every one of you can make it.");

		JList list = new JList(noteListModel);
		JScrollPane listScrollPane = new JScrollPane(list);
		listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		listScrollPane.setPreferredSize(new Dimension(320, 60));
		listScrollPane.setBorder(BorderFactory.createCompoundBorder(
				BorderFactory.createTitledBorder("Note"), 
				BorderFactory.createEmptyBorder(5, 5, 5, 5)));
		add(listScrollPane);
	}

}
